package cn.tedu.store.util;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 向客户端响应操作结果的数据类型
 * @author Administrator
 *
 * @param <T>向客户端响应的数据类型
 */
//@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)     旧的
@JsonInclude(JsonInclude.Include.NON_NULL)
//该备注在输出json时禁止输出null值，还可以写在属性上或在application.properties中配置为全局，则本地可不用配置
public class JsonResult<T> {
	private Integer state;
	private String message;
	private T data;
	
	
	
	public JsonResult(Integer state, T data) {
		super();
		this.state = state;
		this.data = data;
	}
	public JsonResult(Integer state) {
		super();
		this.state = state;
	}
	public JsonResult() {
		
	}
	public Integer getState() {
		return state;
	}
	public void setState(Integer state) {
		this.state = state;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public T getData() {
		return data;
	}
	public void setData(T data) {
		this.data = data;
	}

}
